from dataaccess import MemberData
from common import utility

class MemberBiz(object):
    def __init__(self):
        pass

    def __ValidateInsert(self, member):
        valid = True
        if not valid:
            raise utility.BusinessException(message="",fieldName = "")
        
    def __ValidateUpdate(self, member):
        valid = True
        if not valid:
            raise utility.BusinessException(message="",fieldName = "")
        
    def __ValidateDelete(self, username):
        valid = True
        if not valid:
            raise utility.BusinessException(message="",fieldName = "")
        
    def InsertMember(self, member):
        self.__ValidateInsert(member)
        memberData = MemberData.MemberData()
        return memberData.InsertMember(member)

    def UpdateMember(self, member):
        self.__ValidateUpdate(member)
        memberData = MemberData.MemberData()
        memberData.UpdateMember(member)

    def DeleteMember(self, username):
        self.__ValidateDelete(username)
        memberData = MemberData.MemberData()
        memberData.DeleteMember(username)
